package day12;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread4 extends Thread {
    public Thread4(String name){
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i <20 ; i++) {
            System.out.println(this.getName()+"打印了 "+i);
            super.yield();
        }
    }

    public static void main(String[] args) {
        for (int i = 1; i <6 ; i++) {
            Thread4 th=new Thread4("线程"+i);
            th.start();
        }
    }
}
